import React from 'react'
import RouterView from '../route'
import { withRouter } from 'react-router-dom'

function Home({ child, history }) {
    return (
        <div className='h100'>
            <main>
                <RouterView routes = { child }/>
            </main>
            
            <footer className='footer'>
                {
                    child.map((item, index) => {
                        return <div onClick={() => {
                            history.push(item.path)
                        }}  key={index}>
                            { item.title }
                        </div>
                    })
                }
            </footer>
    
        </div>
    )
}

export default withRouter(Home)
